from django.urls import path, include
from rest_framework.routers import DefaultRouter
from shopping.views import ProductViewSet, BrowsingRecordView, FavoriteRecordView, OrderRecordView, FavoriteListView, OrderListView, BrowsingListView, HotProductListView, Recommend, CartRecordView, AlipayOrderView, AlipayNotifyView, CartPayView, OrderDetailView

router = DefaultRouter()
router.register(r'products', ProductViewSet, basename='product')

urlpatterns = [
    path('', include(router.urls)),
    path('browse/', BrowsingRecordView.as_view()),
    path('browse/list/', BrowsingListView.as_view()),
    path('favorite/', FavoriteRecordView.as_view()),
    path('favorite/list/', FavoriteListView.as_view()),
    path('order/', OrderRecordView.as_view()),
    path('order/list/', OrderListView.as_view()),
    path('hotlist/', HotProductListView.as_view()),
    path('recommend/', Recommend.as_view()),
    path('cart/', CartRecordView.as_view()),
    path('alipay/order/', AlipayOrderView.as_view()),
    path('alipay/notify/', AlipayNotifyView.as_view()),
    path('cart/pay/', CartPayView.as_view()),
    path('order/detail/', OrderDetailView.as_view()),
]